package com.yowasa.xiuxian.service.helper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yowasa.xiuxian.engine.CommonEngine;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.MapEnum;
import com.yowasa.xiuxian.entity.po.XiuxianMapEnemyPO;
import com.yowasa.xiuxian.entity.po.XiuxianMapInfoPO;
import com.yowasa.xiuxian.exception.HandlerException;
import com.yowasa.xiuxian.mapper.XiuxianMapEnemyMapper;
import com.yowasa.xiuxian.service.QQChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

import java.util.List;

@Component
public class LocalHelper {

    @Autowired
    private XiuxianMapEnemyMapper xiuxianMapEnemyMapper;


    public void moveTo(UserBO bo, MapEnum mapEnum) {
        bo.setLocal(mapEnum.getId());
        bo.setLocalName(mapEnum.getName());

    }

    public List<XiuxianMapEnemyPO> selectLocalEnenmy(int id) {
        return xiuxianMapEnemyMapper.selectList(new LambdaQueryWrapper<XiuxianMapEnemyPO>().eq(XiuxianMapEnemyPO::getMapId,id).groupBy(XiuxianMapEnemyPO::getEnemyName));
    }

}
